/**
 * Classe de testes
 */
package br.com.hpedroni.engine.teste;

import javax.microedition.lcdui.Graphics;

import br.com.hpedroni.engine.core.EngineCanvas;
import br.com.hpedroni.engine.physics.Vector2D;

public class TesteCanvas extends EngineCanvas {

	private Vector2D gravidade;
	private Vector2D forca;
	private Vector2D resultante;
	private Circle circle;
	private Retangle retangle;

	public TesteCanvas() {
		super(false, new Integer(25));
		//super(false, null);
		forca = new Vector2D(0.08, -0.7);
		gravidade = new Vector2D(0, 0.1);
		circle = new Circle(5, 50, 100);

		retangle = new Retangle(0, deviceScreenHeigth - 10, deviceScreenWidth,
				10, true);

		startLoop();
	}

	protected void keyPressed(int keyCode) {
	}

	public void gameLoop(Graphics g) {
		circle.draw(g);
		circle.changePosition(forca.soma(gravidade));
		if(retangle.colidesWith(circle)){
			System.out.println("Colidiu");
		//	gravidade.invert();
		}
		retangle.draw(g);
	}

}
